/**
 * Created by zyy on 15/9/8.
 * zhangyuyu@superjia.com
 */
(function($) {
    'use strict';

    var layout = {
        init: function(container, options) {
            var self = this;
            self.__container = container;
            self.__options = options;

            container.html(tpl);

            self.__projectPanel = container.find('.project-wrap');
            self.__prdPanel = container.find('.prd-wrap');
            self.__apiPanel = container.find('.api-wrap');

            $.jps.trigger('layout-inited', {
                projectPanel: self.__projectPanel,
                prdPanel: self.__prdPanel,
                apiPanel: self.__apiPanel
            })
        },

        switchPanel: function(panel) {
            var self = this;
            var container = self.__container;
            container.find('.' + panel + '-wrap').sibilings().removeClass('active').addClass('active');
        }
    };

    var tpl = '' +
        '<div class="mod-layout clearfix">' +
        '    <div class="project-wrap"></div>' +
        '    <div class="prd-wrap"></div>' +
        '    <div class="api-wrap"></div>' +
        '</div>';


        App.modules.layout = layout;
})(jQuery);
